<cftry>
<cfparam name="dir" default="/">
<cfparam name="filepath" default="">
<cfset uploadto = "#filepath##dir#">
<cfset uploadto = replace(uploadto, "//", "/")>
<cffile action = "upload" filefield="fileData" destination = "#filepath##dir#" nameconflict="makeunique" mode="777">
<cfinvoke component="cfcs.common.shared" method="renamefile" inputfile="#cffile.serverfile#" dir="#dir#" returnvariable="thefile">
<cfcatch type="any">
<cfinclude template="#request.absolutepath#errorprocess.cfm">
</cfcatch>
</cftry>